<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex recommendCommodityList_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center justify-between recommendCommodityList_fd0_0'>
					<view class='flex align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
						<text class='fu-iconfont2  recommendCommodityList_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view style="font-size: 36rpx;font-weight: 500;">教练相关课程</view>
					<view class="recommendCommodityList_fd0_0_c0_c0"></view>
				</view>
			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>

			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#F35D2A"></u-loading>
				<view>加载中</view>
			</view>

			<block v-else>
				<!---flex布局flex布局开始-->
				<view
					class="flex flex-direction flex-wrap align-stretch benben-flex-layout recommendCommodityList_flex_2">
					<template v-for="(item,index) in list">
						<recommend :item="item" :index="index" :baColor="'#fff'"></recommend>
					</template>
				</view>

				<!-- <view class="loadmore" v-if="last_page > 1">
					<u-loadmore font-size="24" :status="status" :icon-type="iconType" :load-text="loadText" />
				</view> -->
			</block>


			<view class="noData" v-if="list.length == 0 && !isShow">
				<image :src='STATIC_URL+"no.png"'></image>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	import recommend from "@/components/reservation/recommend.vue"
	export default {
		components: {
			recommend
		},

		data() {
			return {
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
				"staff_id": "", // 教练id
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				staff_id,
			} = options
			if (staff_id !== undefined) this.staff_id = staff_id;
			this.getList();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {

				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			getList() {
				this.$api.post(global.API_VERSION + '65b74a19aca61', {
					page: this.page,
					staff_id: this.staff_id
				}).then(res => {
					// console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.searchye_fd0_0_c1_c1 {
		margin: 0rpx 0rpx 0rpx 16rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
		flex: 1;
		height: 100%;
		padding: 0 48rpx 0 0;
	}

	.searchye_fd0_0_c1_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.searchye_fd0_0_c1 {
		background: #F9F9F9;
		background-size: 100% auto !important;
		border-radius: 36rpx 36rpx 36rpx 36rpx;
		width: 686rpx;
		height: 64rpx;
		margin: 0 32rpx;
		padding: 0 24rpx;
		position: relative;
	}

	.close_btn {
		width: 40rpx;
		height: 40rpx;
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		right: 16rpx;
	}

	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background-size: 100% auto;
		background-color: #f8f8f8;
	}

	.recommendCommodityList_flex_0 {
		width: 750rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto;
		background: #fff;
		border-bottom: 1px solid #eee;
	}

	.recommendCommodityList_fd0_0_c1_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
		margin: 0rpx 0rpx 0rpx 16rpx;
		width: 336rpx;
	}

	.recommendCommodityList_fd0_0_c1_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.recommendCommodityList_fd0_0_c1 {
		background: #F9F9F9;
		height: 64rpx;
		width: 436rpx;
		border-radius: 34rpx 34rpx 34rpx 34rpx;
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.recommendCommodityList_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		width: 50rpx;
	}

	.recommendCommodityList_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
		width: 100%;
	}

	.recommendCommodityList_flex_1 {
		background: #FFFFFF;
	}

	.recommendCommodityList_titlefd1_0_c0_c4 {
		margin: 0rpx 68rpx 0rpx 68rpx;
	}

	.recommendCommodityList_titlefd1_0_c0_c5 {
		margin: 0rpx 68rpx 0rpx 68rpx;
	}

	.recommendCommodityList_titleItemfd1_0_c0_c3_c0 {
		// font-size: 28rpx;
		font-weight: 400;
	}

	.recommendCommodityList_titlefd1_0_c0_c3 {
		margin: 0rpx 64rpx 0rpx 64rpx;
		// font-size: 32rpx;
		font-weight: 500;
	}

	.recommendCommodityList_linefd1_0_c0 {
		background: #F35D2A;
		width: 40rpx;
		height: 5rpx;
		top: 84rpx;
		background-size: 100% auto !important;
		border-radius: 3rpx 3rpx 0rpx 0rpx;
	}

	.checkTitlefd1_0_c0 {
		font-weight: 500 !important;
		font-size: 32rpx !important;
		color: #333 !important;
	}

	::v-deep .recommendCommodityList_benbenTabsfd1_0_c0 {
		background: #fff;
		// width: 750rpx;
		height: 90rpx;
		white-space: nowrap;
		text-align: center;
	}

	.recommendCommodityList_fd1_0 {
		// padding: 0rpx 32rpx 0rpx 32rpx;
		justify-content: center;
	}

	.recommendCommodityList_flex_2 {
		background-size: 100% auto;
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.recommendCommodityList_fd2_0 {
		background: var(--benbenbgColor1);
	}

	.recommendCommodityList_flex_3 {
		background-size: 100% auto;
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.recommendCommodityList_fd3_0_c0_c2_c0 {
		width: 44rpx;
		height: 44rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.recommendCommodityList_fd3_0_c0_c2 {
		position: absolute;
		right: 20rpx;
		top: 20rpx;
	}

	.recommendCommodityList_fd3_0_c0_c1_c1_c3 {
		color: #666666;
		font-size: 24rpx;
		font-weight: 400;
		max-width: 45rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.recommendCommodityList_fd3_0_c0_c1_c1_c2 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 13rpx 0rpx auto;
	}

	.recommendCommodityList_fd3_0_c0_c1_c1_c1 {
		color: #666666;
		font-size: 24rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 0rpx 12rpx;
	}

	.recommendCommodityList_fd3_0_c0_c1_c1_c0 {
		width: 40rpx;
		height: 40rpx;
		border-radius: 20rpx;
	}

	.recommendCommodityList_fd3_0_c0_c1_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 500;
		padding: 19rpx 0rpx 24rpx 0rpx;
	}

	.recommendCommodityList_fd3_0_c0_c1 {
		padding: 0rpx 25rpx 0rpx 20rpx;
	}

	.recommendCommodityList_fd3_0_c0_c0 {
		width: 335rpx;
		height: 450rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.recommendCommodityList_fd3_0_c0 {
		background: rgba(247, 246, 244, 1);
		padding: 0rpx 0rpx 24rpx 0rpx;
		background-size: 100% auto;
		position: relative;
	}

	.recommendCommodityList_flex_4 {
		background: var(--benbenbgColor1);
		padding: 0rpx 30rpx 0rpx 30rpx;
		background-size: 100% auto !important;
	}

	.recommendCommodityList_fd4_0_c2_1 {
		border: 1px solid #AD3823;
		background: rgba(173, 56, 35, 1);
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		height: 64rpx;
	}

	.recommendCommodityList_fd4_0_c2 {
		border: 1px solid #AD3823;
		background: var(--benbenbgColor1);
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: rgba(173, 56, 35, 1);
		height: 64rpx;
	}

	.recommendCommodityList_fd4_0_c1_c1_c1 {
		background: var(--benbenbgColor6);
		width: 1rpx;
		height: 30rpx;
		margin: 0rpx 10rpx 0rpx 10rpx;
		transform: scaleX(0.5);
	}

	.recommendCommodityList_fd4_0_c1_c1_c0_c1 {
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.recommendCommodityList_fd4_0_c1_c1 {
		color: #999999;
		font-size: 24rpx;
		line-height: 33rpx;
		font-weight: 400;
	}

	.recommendCommodityList_fd4_0_c1_c0 {
		color: #000000;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 40rpx;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.recommendCommodityList_fd4_0_c0 {
		width: 108rpx;
		height: 108rpx;
		border-radius: 54rpx;
		margin: 0rpx 23rpx 0rpx 0rpx;
	}

	.recommendCommodityList_fd4_0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}


	.littleTheatre_fd2_0_c1_c2_c0_c0 {
		color: #AD3823;
		font-size: 28rpx;
		font-weight: 400;
	}

	.littleTheatre_fd2_0_c1_c2_c0 {
		background: #FFFFFF;
		width: 144rpx;
		height: 52rpx;
		// transform: translateY(-12rpx);
		position: absolute;
		bottom: 0;
		right: 0;
		border-radius: 24rpx 16rpx 0 0;
	}

	.littleTheatre_fd2_0_c1_c1_c1 {
		color: #333333;
		font-size: 34rpx;
		font-weight: 400;
		margin: 15rpx 0rpx 4rpx 0rpx;
	}

	.littleTheatre_fd2_0_c1_c1_c0 {
		color: #333333;
		font-size: 48rpx;
		font-weight: 400;
	}

	.littleTheatre_fd2_0_c1_c1 {
		margin: 56rpx 0rpx 0rpx 0rpx;
	}

	.littleTheatre_fd2_0_c1_c0 {
		width: 56rpx;
		height: 56rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		position: absolute;
		left: 24rpx;
		top: 24rpx;
	}

	.littleTheatre_fd2_0_c1 {
		// background: url(https://www.guochaoxiaoju.com/uploads/mini/514.png) no-repeat;
		background-size: 100% 220rpx;
		background-repeat: no-repeat;
		position: relative;
		margin: 0rpx 0rpx 24rpx 0rpx;
		height: 220rpx;
	}





	.otherFollow_fd1_1_c2_2 {
		border: 1px solid #62889B;
		background: #F8F8F8;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: rgba(98, 136, 155, 1);
		height: 64rpx;
	}

	.otherFollow_fd1_1_c2_1 {
		border: 1px solid #AD3823;
		background: var(--benbenbgColor2);
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		height: 64rpx;
	}

	.otherFollow_fd1_1_c2 {
		border: 1px solid #AD3823;
		background: #F8F8F8;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 172rpx;
		line-height: 64rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor4);
		height: 64rpx;
	}

	.otherFollow_fd1_1_c1_c1_c1 {
		background: var(--benbenbgColor6);
		width: 1rpx;
		height: 30rpx;
		margin: 0rpx 10rpx 0rpx 10rpx;
		transform: scaleX(0.5);
	}

	.otherFollow_fd1_1_c1_c1_c0_c1 {
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.otherFollow_fd1_1_c1_c1 {
		color: #999999;
		font-size: 24rpx;
		line-height: 33rpx;
		font-weight: 400;
	}

	.otherFollow_fd1_1_c1_c0 {
		color: #000000;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 40rpx;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.otherFollow_fd1_1_c0 {
		width: 108rpx;
		height: 108rpx;
		border-radius: 54rpx;
		margin: 0rpx 23rpx 0rpx 0rpx;
	}

	.otherFollow_fd1_1 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}
</style>